Content-type: text/html

<HTML><HEAD><TITLE>Manpage of zinject</TITLE>
</HEAD><BODY>
<H1>zinject</H1>
Section: System Administration Commands (8)<BR>Updated: 2013 FEB 28<BR><A HREF="#index">Index</A>
<A HREF="/man/man2html">Return to Main Contents</A><HR>

<P>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

zinject - ZFS Fault Injector
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>

<B>zinject</B>

creates artificial problems in a ZFS pool by simulating data corruption or device failures. This program is dangerous.
<A NAME="lbAD">&nbsp;</A>
<H2>SYNOPSIS</H2>

<DL COMPACT>
<DT><B>zinject</B>

<DD>
List injection records.
<DT><B>zinject -b </B><I>objset:object:level:blkd</I><B> [-f </B><I>frequency</I><B>] [-amu] </B><I>pool</I><B></B>

<DD>
Force an error into the pool at a bookmark.
<DT><B>zinject -c &lt;</B><I>id</I><B> | all&gt;</B>

<DD>
Cancel injection records.
<DT><B>zinject -d </B><I>vdev</I><B> -A &lt;degrade|fault&gt; </B><I>pool</I><B></B>

<DD>
Force a vdev into the DEGRADED or FAULTED state.
<DT><B>zinject -d </B><I>vdev</I><B> -D latency:lanes </B><I>pool</I><B></B>

<DD>
<P>
Add an artificial delay to IO requests on a particular
device, such that the requests take a minimum of 'latency'
milliseconds to complete. Each delay has an associated
number of 'lanes' which defines the number of concurrent
IO requests that can be processed.
<P>
For example, with a single lane delay of 10 ms (-D 10:1),
the device will only be able to service a single IO request
at a time with each request taking 10 ms to complete. So,
if only a single request is submitted every 10 ms, the
average latency will be 10 ms; but if more than one request
is submitted every 10 ms, the average latency will be more
than 10 ms.
<P>
Similarly, if a delay of 10 ms is specified to have two
lanes (-D 10:2), then the device will be able to service
two requests at a time, each with a minimum latency of
10 ms. So, if two requests are submitted every 10 ms, then
the average latency will be 10 ms; but if more than two
requests are submitted every 10 ms, the average latency
will be more than 10 ms.
<P>
Also note, these delays are additive. So two invocations
of '-D 10:1', is roughly equivalent to a single invocation
of '-D 10:2'. This also means, one can specify multiple
lanes with differing target latencies. For example, an
invocation of '-D 10:1' followed by '-D 25:2' will
create 3 lanes on the device; one lane with a latency
of 10 ms and two lanes with a 25 ms latency.
<P>
<DT><B>zinject -d </B><I>vdev</I><B> [-e </B><I>device_error</I><B>] [-L </B><I>label_error</I><B>] [-T </B><I>failure</I><B>] [-f </B><I>frequency</I><B>] [-F] </B><I>pool</I><B></B>

<DD>
Force a vdev error.
<DT><B>zinject -I [-s </B><I>seconds</I><B> | -g </B><I>txgs</I><B>] </B><I>pool</I><B></B>

<DD>
Simulate a hardware failure that fails to honor a cache flush.
<DT><B>zinject -p </B><I>function</I><B> </B><I>pool</I><B></B>

<DD>
Panic inside the specified function.
<DT><B>zinject -t data [-C </B><I>dvas</I><B>] [-e </B><I>device_error</I><B>] [-f </B><I>frequency</I><B>] [-l </B><I>level</I><B>] [-r </B><I>range</I><B>] [-amq] </B><I>path</I><B></B>

<DD>
Force an error into the contents of a file.
<DT><B>zinject -t dnode [-C </B><I>dvas</I><B>] [-e </B><I>device_error</I><B>] [-f </B><I>frequency</I><B>] [-l </B><I>level</I><B>] [-amq] </B><I>path</I><B></B>

<DD>
Force an error into the metadnode for a file or directory.
<DT><B>zinject -t </B><I>mos_type</I><B> [-C </B><I>dvas</I><B>] [-e </B><I>device_error</I><B>] [-f </B><I>frequency</I><B>] [-l </B><I>level</I><B>] [-r </B><I>range</I><B>] [-amqu] </B><I>pool</I><B></B>

<DD>
Force an error into the MOS of a pool.
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>

<DL COMPACT>
<DT><B>-a</B>

<DD>
Flush the ARC before injection.
<DT><B>-b</B><I> objset:object:level:start:end</I>

<DD>
Force an error into the pool at this bookmark tuple. Each number is
in hexadecimal, and only one block can be specified.
<DT><B>-C</B><I> dvas</I>

<DD>
Inject the given error only into specific DVAs. The mask should be
specified as a list of 0-indexed DVAs separated by commas (ex. '0,2'). This
option is not applicable to logical data errors such as
<B>decompress</B>

and
<B>decrypt</B>.

<DT><B>-d</B><I> vdev</I>

<DD>
A vdev specified by path or GUID.
<DT><B>-e</B><I> device_error</I>

<DD>
Specify
<B>checksum</B> for an ECKSUM error,

<B>decompress</B> for a data decompression error,

<B>decrypt</B> for a data decryption error,

<B>corrupt</B> to flip a bit in the data after a read,

<B>dtl</B> for an ECHILD error,

<B>io</B> for an EIO error where reopening the device will succeed, or

<B>nxio</B> for an ENXIO error where reopening the device will fail.

For EIO and ENXIO, the &quot;failed&quot; reads or writes still occur.  The probe simply
sets the error value reported by the I/O pipeline so it appears the read or
write failed.  Decryption errors only currently work with file data.
<DT><B>-f</B><I> frequency</I>

<DD>
Only inject errors a fraction of the time. Expressed as a real number
percentage between 0.0001 and 100.
<DT><B>-F</B>

<DD>
Fail faster. Do fewer checks.
<DT><B>-g</B><I> txgs</I>

<DD>
Run for this many transaction groups before reporting failure.
<DT><B>-h</B>

<DD>
Print the usage message.
<DT><B>-l</B><I> level</I>

<DD>
Inject an error at a particular block level. The default is 0.
<DT><B>-L</B><I> label_error</I>

<DD>
Set the label error region to one of
<B> nvlist</B>,

<B> pad1</B>,

<B> pad2</B>, or

<B> uber</B>.

<DT><B>-m</B>

<DD>
Automatically remount the underlying filesystem.
<DT><B>-q</B>

<DD>
Quiet mode. Only print the handler number added.
<DT><B>-r</B><I> range</I>

<DD>
Inject an error over a particular logical range of an object, which
will be translated to the appropriate blkid range according to the
object's properties.
<DT><B>-s</B><I> seconds</I>

<DD>
Run for this many seconds before reporting failure.
<DT><B>-T</B><I> failure</I>

<DD>
Set the failure type to one of
<B> all</B>,

<B> claim</B>,

<B> free</B>,

<B> read</B>, or

<B> write</B>.

<DT><B>-t</B><I> mos_type</I>

<DD>
Set this to
<B>mos </B>for any data in the MOS,

<B>mosdir </B>for an object directory,

<B>config </B>for the pool configuration,

<B>bpobj </B>for the block pointer list,

<B>spacemap </B>for the space map,

<B>metaslab </B>for the metaslab, or

<B>errlog </B>for the persistent error log.

<DT><B>-u</B>

<DD>
Unload the pool after injection.
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>ENVIRONMENT VARIABLES</H2>

<DL COMPACT>
<DT><B>ZINJECT_DEBUG</B>

<DD>
Run <B>zinject</B> in debug mode.
<P>
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>AUTHORS</H2>

This man page was written by Darik Horn &lt;<A HREF="mailto:dajhorn@vanadac.com">dajhorn@vanadac.com</A>&gt;
excerpting the <B>zinject</B> usage message and source code.
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>

<B><A HREF="/man/man2html?8+zpool">zpool</A></B>(8),

<B><A HREF="/man/man2html?8+zfs">zfs</A></B>(8)

<P>

<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">DESCRIPTION</A><DD>
<DT><A HREF="#lbAD">SYNOPSIS</A><DD>
<DT><A HREF="#lbAE">OPTIONS</A><DD>
<DT><A HREF="#lbAF">ENVIRONMENT VARIABLES</A><DD>
<DT><A HREF="#lbAG">AUTHORS</A><DD>
<DT><A HREF="#lbAH">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:49:32 GMT, September 27, 2019
</BODY>
</HTML>
